package com.yan_jiu_sheng.JavaAdvance.a_ticked;

/**
 * @author yulongTian
 * @create 2024-05-26 13:19
 */
public class MyTicket implements Runnable {

    int tickets = 100;

    @Override
    public void run() {
        while (true) {
            if (tickets > 0) {
                System.out.println(Thread.currentThread().getName() + "买了第" + tickets + "张票");
                tickets--;
            }
        }
    }
}
